package org.gitos.cloud.domain.server;

import org.gitos.cloud.domain.tcp.Bucket;
import org.gitos.cloud.util.HexUtil;
import org.springframework.jdbc.core.RowMapper;

import java.io.Serializable;
import java.net.InetSocketAddress;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Arrays;

/**
 * Created by hc on 2016/3/29 0029.
 */
public class Rom implements Serializable, RowMapper<Rom> {
    public static final int WIFI_ROM=1;
    public static final int MCU_ROM=2;

    private String uuid;
    private String led_mac;
    private String name;
    private String version;
    private String url;
    private int type=0;

    public String getUuid() {
        return uuid;
    }

    public void setUuid(String uuid) {
        this.uuid = uuid;
    }

    public String getLed_mac() {
        return led_mac;
    }

    public void setLed_mac(String led_mac) {
        this.led_mac = led_mac;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    @Override
    public Rom mapRow(ResultSet rs, int rowNum) throws SQLException {
        Rom rom = new Rom();
        rom.setLed_mac(rs.getString("led_mac"));
        rom.setName(rs.getString("name"));
        rom.setVersion(rs.getString("version"));
        rom.setType(rs.getInt("type"));
        rom.setUrl(rs.getString("url"));
        rom.setUuid(rs.getString("uuid"));
        return rom;
    }
}
